package com.skywo.demo1.common.result

class RF {
    companion object {
        fun <T> success(data: T): R<T> {
            return R.Success(data)
        }

        fun fail(code: Int?, message: String?): R<Nothing> {
            return R.Fail(code, message)
        }

        fun fail(resultCode: ResultCode): R<Nothing> {
            return R.Fail(resultCode.code, resultCode.message)
        }

        fun fail(resultCode: ResultCode, message: String?): R<Nothing> {
            return R.Fail(resultCode.code, message)
        }

    }
}